package judlawei.gui;



import javax.swing.ButtonGroup;
import javax.swing.GroupLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.LayoutStyle;

public class SelecionadorTipo extends JPanel{

    private JLabel rotTipo;
    private JRadioButton selectLeg;
    private JRadioButton selectSTF;
    private JRadioButton selectSTJ;
    private ButtonGroup buttonGroup;

    
    public SelecionadorTipo(){
        
        initComponents();
        construirLayout();
        configurarExclusaoMut();
    }
    
    
    private void initComponents(){
        selectSTJ = new JRadioButton();
        selectSTF = new JRadioButton();
        selectLeg = new JRadioButton();
        rotTipo = new JLabel();
        
        
        selectLeg.setText("Legislativo");
        selectSTF.setText("STF");
        selectSTJ.setText("STJ");
        rotTipo.setText("Tipo:");
    }
    
    
    /**
     * 
     */
    private void configurarExclusaoMut(){
        buttonGroup = new ButtonGroup();
        buttonGroup.add(selectLeg);
        buttonGroup.add(selectSTF);
        buttonGroup.add(selectSTJ);
           
    }
    
    
    
    private void construirLayout(){
        GroupLayout selecionadorTipoLayout = new GroupLayout(this);
        this.setLayout(selecionadorTipoLayout);
        selecionadorTipoLayout.setHorizontalGroup(
            selecionadorTipoLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(GroupLayout.Alignment.TRAILING, selecionadorTipoLayout.createSequentialGroup()
                .addContainerGap(60, Short.MAX_VALUE)
                .addComponent(rotTipo)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(selecionadorTipoLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addComponent(selectSTF)
                    .addComponent(selectSTJ)
                    .addComponent(selectLeg))
                .addGap(18, 18, 18))
        );
        selecionadorTipoLayout.setVerticalGroup(
            selecionadorTipoLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(selecionadorTipoLayout.createSequentialGroup()
                .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(selecionadorTipoLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                    .addComponent(rotTipo)
                    .addComponent(selectLeg))
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(selectSTF)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(selectSTJ, GroupLayout.PREFERRED_SIZE, 23, GroupLayout.PREFERRED_SIZE))
                
        );
    }
    
    
    
}
